package com.example.springcloud.springcloudfeign.fallback;

import com.example.springcloud.springcloudfeign.User;
import com.example.springcloud.springcloudfeign.feign.FeignService;

/**
 * FeignService请求远端的服务，那么如何请求降级？
 *
 *  只需要实现自定义的 FeignService 接口，并且返回一个值就可以了。
 *
 * weiximei on 2018/6/10
 */
public class FeignFallBack implements FeignService {

    @Override
    public String hello() {
        return "error";
    }

    @Override
    public String hello(String name) {
        return "error";
    }

    @Override
    public User hello(String name, Integer age) {
        return new User();
    }

    @Override
    public String hello(User user) {
        return "error";
    }
}
